##############################################################
## MOD Title:		Email Confirmation Mod
## MOD Author:		Kooky <kooky@altern.org> http://perso.edeign.com/kooky/
## MOD Description:	This mod will add an email confirmation field when a user
##			will try to register.
##			Also if a user edits his profile, this field is already required.
## MOD Version:		0.9.0
## Compatibility:	2.0.6 - 2.0.8
##
## Installation Level:	Moderate
## Installation Time:	10 Minutes
## Files to Edit:	4
##			includes/usercp_avatar.php
##			includes/usercp_register.php
##			language/lang_english/lang_main.php
##			templates/subSilver/profile_add_body.tpl
## Included Files:	N/A
##
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbbhacks.com/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB Hacks will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbhacks.com
##############################################################
## Author Notes:
##
## 1. Copyright and special thanks!
## -----------
## If you want to add this Mod to any database, please don't add
## my e-mail address to a topic, just point to my website (see above).
## (for spamming prevention)
##
## 2. EasyMOD
## -----------
## This MOD is compatible with EasyMOD of Nuttzy and can be
## installed by it but is not yet certified EMC (EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually!
##
## 3. Official last version link
## -----------
## Check this official link for latest updates...
## http://perso.edeign.com/kooky/
##
##############################################################
## MOD History:
##
## 2003/10/01 - Version 0.9.0.
##	- initial BETA release phpBB2
##	- Easy Mod compliant
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Start add - Email Confirmation
$lang['Email_confirm'] = 'Confirm your email address';
$lang['Email_mismatch'] = 'Email addresses you have entered do not match.';
// End add - Email Confirmation
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
		$current_email = trim(htmlspecialchars($HTTP_POST_VARS['current_email']));
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// Start add - Email Confirmation
		$email_confirm = trim(htmlspecialchars($HTTP_POST_VARS['email_confirm']));
		// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
	$strip_var_list = array('username' => 'username', 'email' => 'email'
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'email' => 'email'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'email_confirm' => 'email_confirm'
#
#-----[ FIND ]------------------------------------------
#
		$email = stripslashes($email);
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// Start add - Email Confirmation
		$email_confirm = stripslashes($email_confirm);
		// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
		if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
#
#-----[ IN-LINE FIND ]------------------------------------------
#
|| empty($email)
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 || empty($email_confirm)
#
#-----[ FIND ]------------------------------------------
#
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
		}
	}
#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Start add - Email Confirmation
	else if ( $email != $email_confirm )
	{
		$error = TRUE;
		$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Email_mismatch'];
	}
	// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
	// Do a ban check on this email address
	//
	if ( $email != $userdata['user_email'] || $mode == 'register' )
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$email != $userdata['user_email']
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 || $email_confirm != $userdata['user_email'] || $email != $email_confirm
#
#-----[ FIND ]------------------------------------------
#
		$result = validate_email($email);
		if ( $result['error'] )
		{
			$email = $userdata['user_email'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
			// Start add - Email Confirmation
			$email_confirm = $userdata['user_email'];
			$email = $email_confirm;
			// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $result['error_msg'];
		}
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// Start add - Email Confirmation
		else if ( $email != $email_confirm )
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Email_mismatch'];
		}
		// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
			if ( $row['user_password'] != md5($cur_password) )
			{
				$email = $userdata['user_email'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
				// Start add - Email Confirmation
				$email_confirm = $userdata['user_email'];
				$email = $email_confirm;
				// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
	$email = stripslashes($email);
#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Start add - Email Confirmation
	$email_confirm = stripslashes($email_confirm);
	// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
	$email = $userdata['user_email'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Start add - Email Confirmation
	$email_confirm = $userdata['user_email'];
	// End add - Email Confirmation
#
#-----[ FIND ]------------------------------------------
#
	display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $current_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $email_confirm
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $coppa, $username, $email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $email_confirm
#
#-----[ FIND ]------------------------------------------
#
		'L_EMAIL_ADDRESS' => $lang['Email_address'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// Start add - Email Confirmation
		'L_CONFIRM_EMAIL' => $lang['Email_confirm'],
		'EMAIL_CONFIRM' => $email_confirm,
		// End add - Email Confirmation
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_avatar.php

#
#-----[ FIND ]------------------------------------------
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email,
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, &$current_email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, &$email_confirm
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, &$coppa, &$username, &$email
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, &$email_confirm
#
#-----[ FIND ]------------------------------------------
#
	$params = array('coppa', 'user_id', 'username', 'email', 'current_email',
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 'current_email'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'email_confirm'
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
	<tr> 
		<td class="row1"><span class="gen">{L_EMAIL_ADDRESS}: *</span></td>
		<td class="row2"><input type="text" class="post" style="width:200px" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------
#
	<tr>
		<td class="row1"><span class="gen">{L_CONFIRM_EMAIL}: *</span></td>
		<td class="row2">
			<input type="text" class="post" name="email_confirm" style="width: 200px" size="25" maxlength="255" value="{EMAIL_CONFIRM}" />
		</td>
	</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM